<?php
use yii\helpers\Url;

/* @var $this yii\web\View */

$this->registerMetaTag(['name' => 'keywords', 'content' => '建站技术,sickeeer,塞卡博客']);
$this->registerMetaTag(['name'=>'description','content'=>'塞卡博客,是一个专注于前端Hmtl、css、js，后端php等建站技术的原创技术博客,作者塞卡(sickeeer)。']);
$this->registerMetaTag(['name'=>"baidu-site-verification",'content'=>"Oa8bVSuKVl"]);

$this->params['active'] = 'index';
$authorname = Yii::$app->params['author_name'];
$catname = Yii::$app->params['cat_name'];
$desc = explode('<!--more-->', $hot['describe']);
?>
<?php
$hide = <<<EOC
  <div class="am-u-md-12 pf0">
    <div class="am-slider am-slider-default" data-am-flexslider id="demo-slider-0">
      <ul class="am-slides">
        <li><img src="http://s.amazeui.org/media/i/demos/bing-1.jpg" height="220" /></li>
        <li><img src="http://s.amazeui.org/media/i/demos/bing-2.jpg" height="220" /></li>
      </ul>
    </div>
  </div>
EOC;
?>
  <div class="am-u-md-9">
    <div class="blog-content">
    <div class="blog-firstitle">
        <h3>
            <i class="am-icon-fire"></i> 头条<!-- <span><a href="javascript:void(0)">往期&gt;</a></span> -->
        </h3>
        <div class="article-title">
            <a href="<?=Url::to(['article/content','catSlug'=>$catname[$hot['catid']]['slug'],'slug'=>$hot['slug']])?>"><?=$hot['title']?></a>
        </div>
        <h4 class="am-article-meta blog-meta">
            by <a href="javascript:void(0)"><?=$authorname[$hot['author_id']]['text']?></a> posted on <?=date("Y/m/d", $hot['news_time'])?> under <a href="<?=Url::to(['article/index','catSlug'=>$catname[$hot['catid']]['slug'],'page'=>1])?>"><?=$catname[$hot['catid']]['text']?></a>
        </h4>
        <div class=".am-article-bd">
            <?=strip_tags($desc[0])?>
        </div>
    </div>
<?php
$hide = <<<EOC
    <div class="blog-hot">
        <h3>热门<div class="hot-slider-control"><a href="javascript:void(0)" class="am-icon-chevron-left" onclick="$('#hot-slider').flexslider('prev')" ></a><a href="javascript:void(0)"  class="am-icon-chevron-right" onclick="$('#hot-slider').flexslider('next')" ></a></div></h3>
        <hr />
        <div id="hot-slider" class="am-slider am-slider-default am-slider-carousel" data-am-flexslider="{controlNav: false,directionNav:false,slideshow:false}">
            <ul class="am-slides">
                <li> 
                    <a href="/articles/2239" class="_square-hot-img">
                      <img src="https://oss.aliyuncs.com/yqfiles/img_b0e43c5e73812d3e7927b4a672840e03.png" alt="mysql 主备复制下的可靠性漫谈（三）" height="190" width="864">
                    </a>
                    <p class="_square-hot-title text-overflow"><a href="/articles/2239" title="mysql 主备复制下的可靠性漫谈（三）">mysql 主备复制下的可靠性漫谈（三）</a></p>
                    <p class="_square-count">
                      <span>22人浏览</span>
                      <span>0人评论</span>
                      <span>0人赞</span>
                      <span>0人关注</span>
                </li>
                <li>
                    <a href="/articles/2255" class="_square-hot-img">
                      <img src="https://oss.aliyuncs.com/yqfiles/img_9711b07be82ebc78182738457462be08.jpg" alt="域模型之一， 域模型的价值" height="190" width="864">
                    </a>
                    <p class="_square-hot-title"><a href="/articles/2255" title="域模型之一， 域模型的价值">域模型之一， 域模型的价值</a></p>
                    <p class="_square-count">
                      <span>31人浏览</span>
                      <span>0人评论</span>
                      <span>0人赞</span>
                      <span>0人关注</span>
                    </p>
                </li>
            </ul>
        </div>
    </div>
EOC;
?>
    <div class="blog-article">
        <h3>精彩文章</h3>
        <hr />  
        <div class="am-u-md-6">
            <h4>前端技术</h4>
            <ul>
                <?php if($frontend) :
                foreach($frontend as $k=>$v): 
                    if($k == 0):
                ?>
                <li class="first-article">
                    <div class="article-title text-overflow"><a href="<?=Url::to(['article/content','catSlug'=>$catname[$v['catid']]['slug'],'slug'=>$v['slug']])?>" title="<?=$v['title']?>"><?=$v['title']?></a></div>
                    <div class="media-body">
                        <?=mb_substr(strip_tags($v['describe']),0,50),'...'?>
                        <div class="_square-count">
                            <a href="javascript:void(0)"><?=$authorname[$v['author_id']]['text']?></a> • <span><?=$v['read_num']?>人浏览</span><!--<span>0人评论</span><span>2人赞</span>-->
                        </div>
                    </div>
                </li>
            <?php continue; endif; ?>
                <li class="text-overflow">• <a href="<?=Url::to(['article/content','catSlug'=>$catname[$v['catid']]['slug'],'slug'=>$v['slug']])?>" title="<?=$v['title']?>"><?=$v['title']?></a></li>
            <?php endforeach; endif; ?>
            </ul>
        </div>
        
        <div class="am-u-md-6">
            <h4>后台脚本</h4>
            <ul>
                <?php if($frontend) :
                foreach($backend as $k=>$v) :
                    if($k == 0):
                ?>
                <li class="first-article">
                    <div class="article-title text-overflow"><a href="<?=Url::to(['article/content','catSlug'=>$catname[$v['catid']]['slug'],'slug'=>$v['slug']])?>" title="<?=$v['title']?>"><?=$v['title']?></a></div>
                    <div class="media-body">
                        <?=mb_substr(strip_tags($v['describe']),0,50),'...'?>
                        <div class="_square-count">
                            <a href="javascript:void(0)"><?=$authorname[$v['author_id']]['text']?></a> • <span><?=$v['read_num']?>人浏览</span>
                        </div>
                    </div>
                </li>
            <?php continue; endif; ?>
                <li class="text-overflow">• <a href="<?=Url::to(['article/content','catSlug'=>$catname[$v['catid']]['slug'],'slug'=>$v['slug']])?>" title="<?=$v['title']?>"><?=$v['title']?></a></li>
            <?php endforeach; endif; ?>
            </ul>
        </div>
        <div class="am-cf"></div>
        <!--<div class="am-u-md-6">
            <h4>数据库</h4>
            <ul>
            </ul>
        </div>
        <div class="am-u-md-6">
            <h4>测试运维</h4>
            <ul>
            </ul>
        </div>-->
    </div>
  </div>
  </div>

  <?= $this->render('/layouts/sidebar') ?>
  <div class="am-cf"></div>